package com.website.custom.service.impl;

import com.website.common.core.text.Convert;
import com.website.common.utils.DateUtils;
import com.website.custom.domain.WBusiness;
import com.website.custom.mapper.WBusinessMapper;
import com.website.custom.service.IWBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 品牌文化Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-25
 */
@Service
public class WBusinessServiceImpl implements IWBusinessService 
{
    @Autowired
    private WBusinessMapper wBusinessMapper;

    /**
     * 查询品牌文化
     * 
     * @param id 品牌文化主键
     * @return 品牌文化
     */
    @Override
    public WBusiness selectWBusinessById(Long id)
    {
        return wBusinessMapper.selectWBusinessById(id);
    }

    /**
     * 查询品牌文化列表
     * 
     * @param wBusiness 品牌文化
     * @return 品牌文化
     */
    @Override
    public List<WBusiness> selectWBusinessList(WBusiness wBusiness)
    {
        return wBusinessMapper.selectWBusinessList(wBusiness);
    }

    /**
     * 新增品牌文化
     * 
     * @param wBusiness 品牌文化
     * @return 结果
     */
    @Override
    public int insertWBusiness(WBusiness wBusiness)
    {
        wBusiness.setCreateTime(DateUtils.getNowDate());
        return wBusinessMapper.insertWBusiness(wBusiness);
    }

    /**
     * 修改品牌文化
     * 
     * @param wBusiness 品牌文化
     * @return 结果
     */
    @Override
    public int updateWBusiness(WBusiness wBusiness)
    {
        wBusiness.setUpdateTime(DateUtils.getNowDate());
        return wBusinessMapper.updateWBusiness(wBusiness);
    }

    /**
     * 批量删除品牌文化
     * 
     * @param ids 需要删除的品牌文化主键
     * @return 结果
     */
    @Override
    public int deleteWBusinessByIds(String ids)
    {
        return wBusinessMapper.deleteWBusinessByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除品牌文化信息
     * 
     * @param id 品牌文化主键
     * @return 结果
     */
    @Override
    public int deleteWBusinessById(Long id)
    {
        return wBusinessMapper.deleteWBusinessById(id);
    }
}
